package com.zt.ztyh.controller;

import com.zt.ztyh.service.ZtyhLevelService;
import com.zt.ztyh.entity.ZtyhLevel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 王利明
 */
@RestController
@RequestMapping("/ztyh/level")
public class LevelController {

    @Autowired
    private ZtyhLevelService ztyhLevelService;

    /**
     * 获取等级
     * 参数为：integer level用户信誉等级（信誉积分+资产积分）
     * 返回值：Level对象，包含信用卡最大额度和贷款最大额度
     * @return
     */
    @GetMapping("/getLevel/{level}")
    public ZtyhLevel getLevel(@PathVariable("level") Integer level){
        return ztyhLevelService.getOneByLevel(level);
    }

}
